LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Export Data to Text file with fix format

Hi Rick,
Thanks for the prompt reply.
Sorry. Data starts from Col C as you have pointed out. It was my
mistake.

Since we import the data, other columns are blank. I need to only
export the columns (digit count shown) as follows:
Col C 1-9 5894 – should display as 5894(and 5 spaces) – total
9
Col F 10-19 Invoice number 12345678 – should display as
001234567 – total 10
Col H 20-27 Invoice date 21.02.2008 should display as 20080221 –
total 8
Col I 28-35 Payment date 21.02.2008 should display as 20080221
– total 8
Col K 36-50 Payment amount, leading zeros, 2 decimals, no
decimal sign – total 15
Col L 51-55 Currency code – EUR, should display EUR(and 2
spaces) – total 5
Col Q 56-66 BIC code bank, with or without branch – total 11

Thanks

On Jul 20, 8:34*pm, "Rick Rothstein \(MVP - VB\)"
wrote:
Can you clarify a couple of things? You say your data is in the range
D10:Q(20000+rows), but your field description shows the first column as C,
not D... which is it? If C is correct, what about column's D and E; if C
should have been D, then what about column E? I added up all the "data" you
laid out and get 63 characters, not the 66 you said would be there... if 66
is correct, and assuming I did not miscount, where do the additional 3
spaces go... in front or at the back of the 66 character record?

Rick

"Rushna" wrote in message

...
Hello All,
I am using Excel 2003 and have data in Range D10:Q(20,000+ rows).
I wish to export the all active rows in the range in the Excel file
to a text file (Notepad).

Details are as follow:

Col C (currently 4 digits) – to be exported (total 9 digits) with
trailing blanks (eg. 1234 – should export as 1234(blank)(blank)(blank)
(blank)(blank)
Col F (currently 8 digits) – to be exported (total 10 digits) with two
leading blanks (eg 12345678 should show as 0012345678)
Col H (currently 21.02.2008 – to be exported as yyyymmdd (eg 20080221)
Col I (currently 21.02.2008 – to be exported as yyyymmdd (eg 20080221)
Col K (currently -43,413.20) – to be exported as total 15 digits with
leading zeros, 2 decimal place, no decimal signs (eg -43,413.20 should
display as 000000004341320 and -1,234.23 should display as
000000000123423 etc)
Col L – to be exported with two trailing blanks (currently EUR –
should display as EUR(blank)(blank).
Col Q – to be exported as ten digits (eg. AABBCCDDXXX). If the cell is
blank nothing should be exported

The output on each line in the text file should be a total width of 66
(including spaces) from various Columns in Excel as explained above
and displayed as follows:

1234(blank)(blank)(blank)(blank)
(blank)00123456782008022120080221000000004341320EU R(blank)
(blank)AABBCCDDXXX (this counts to 66 including blank spaces)

Thanks in advance.

Rushna


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I export data in text format with minimum of spaces? [email protected] Excel Discussion (Misc queries) 1 February 12th 07 10:57 PM
How to make text data export to excel in text format. ~@%.com Excel Programming 3 March 21st 06 03:16 AM
Open CSV file, format data and write output to a text file. BristolBloos Excel Programming 1 October 18th 05 03:50 PM
How do I import text file, analyze data, export results, open next file Geoffro Excel Programming 2 March 6th 05 08:02 PM
Convert data and export to a text file Will[_7_] Excel Programming 1 May 11th 04 09:44 PM


All times are GMT +1. The time now is 05:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"