• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

createing flat file in cold fusion.

Guest
Jun 14, 2006 Jun 14, 2006

Copy link to clipboard

Copied

i got a wddx packet and i have to create a flat file out of that. i can deserialize and write into a file but how can i make it fixed length even though the length of the contents varies in the wddx packet
TOPICS
Advanced techniques

Views

275

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 14, 2006 Jun 14, 2006

Copy link to clipboard

Copied

You could append spaces at the end of the file like so:

#wddx_output##RepeatString(chr(160),fixed_len-len(wddx_output))#

where fixed_len is the desired fixed file length and wddx_output is the deserialized wddx content.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 14, 2006 Jun 14, 2006

Copy link to clipboard

Copied

well, i this file what i am taking about has numbers and chars. i wanted each field to be fixed length. i am not talking about file length. for example. i have name and account number filed. name is 50 chars and a/c num is 10. but the data i am getting is name only 10 chars and a/c num is only 5. now in the first row i am getting total 15 chars rather than getting 10 + 40 spaces and 5 + 5 spaces. how can i get that. do you know anything about WDDX DTD. can this be utilized here... thanks for your help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 14, 2006 Jun 14, 2006

Copy link to clipboard

Copied

LATEST
I've not used WDDX DTD but I think it will only validate that it is the correct format, not alter it to match that format.

Maybe post the code that writes the file so myself or others can give some better advice.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation