Domanda

I have a fixed width text file that I needed to edit about 200 rows of. Importing into excel is easy but when I have completed my edits and try to save the file as a space-delimited or text file all the spacing goes out of whack, i.e the first field in excel is padded out to 6 characters but when I save the file as space-delimited or text it then turns that field into 8 characters.

Please note that I'm using a LEFT(text&REPT(" ", 30)30) formula to get the required padding which works very nicely. However I can't seem to save the file with the correct number of spaces. I have also just tried copying and pasting into a notepad file but this seems to just create more unwanted spaces etc.

How do I create a fixed width file when I have all the data I need and the field length requirements?? Has anyone had this trouble before? Thanks in advance.

È stato utile?

Soluzione 2

I found that the best way to do this was to use Access and save as a text file and then you can set your own field width and export. excellent!

Altri suggerimenti

I agree with Gary's Student. Just go to: Save As -> Formatted Text (Space Delimited) (.prn)*.This will bring almost same functionality as one you have in Excel.

For more information you may refer to: https://superuser.com/questions/100433/export-an-excel-spreadsheet-to-fixed-width-text-file

I'll suggest an export to csv (or similar) and then convert it with UltraEdit's super simple "Convert CSV to fixed with" function.

It scans the file and suggests a column width based on you content. You can easily define your own preferred column width in a 30,25,25,40 pattern.

There's a 30 day trial, if you like it it's well worth the $99 license...

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top