Solved

Export data from excel to a space delimited file

Posted on 2013-05-30
2
1,150 Views
Last Modified: 2013-05-31
I have a spreadsheet that I have adjusted the column widths to prepare the file to be space delimited.

If I save the file as prn file it wraps the text to the line below and this is due to the prn file limitation of 240 characters.

This is what I need the column widths to be to create a space delimited file.

Field      Start      column width
1      1      3
2      4      9
3      13      9
4      22      50
5      72      50
6      122      1
7      123      9
8      132      9
9      141      9
10      150      9
11      159      9
12      168      2
13      170      5
14      175      2
15      177      2
16      179      4
17      183      15
18      198      1
19      199      1
20      200      1
21      201      2
22      203      20
23      223      6
24      229      9
25      238      1
26      239      1
27      240      1
28      241      1
29      242      1
30      243      1
31      244      1
32      245      1
33      246      1


Each column can have either character or numbers in but not exceeding the column widths.

I tried a script Microsoft provide on their website at the following address but it then put field 2 start at position 5.

http://support.microsoft.com/kb/249885

I have attached my original xlsx and the prn file.

Thanks

Luke
test.xlsx
test.prn
0
Comment
Question by:luketr
2 Comments
 
LVL 5

Expert Comment

by:Coffinated
ID: 39209646
Perhaps you could export as comma delimited file, open it in MS word, replace all',' with single space or double space.
0
 
LVL 53

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 39209760
Try changing:

delimiter = " "

to:

delimiter = ""

It looks like the script inserts a space between columns which you don't want.

~bp
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel formula Sumif not working 4 28
Excel - Data Validation 3 29
VBA taking too long 5 20
remove computer from using logon script 17 23
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question