HI

I would likt to create input files for testing, format is like this

INPUT Format

DISP NUM BYTES Desc
0 4 CODE
4 10 EMP NO
14 3 AGE
17 1 SEX

which will be used for creating flat files ( data in excel file).

OUTPUT file should be continous like

CODE19239625M

like this

Here CODE is the EMPCODE, 192396 is EMPNO, 25 is the AGE and M is SEX.

Can anyone will lead me to write the script ......... PLZ help

Hey There,

I'm not sure if you want to create input files or parse input files to put into excel spreadsheet format. If you want the output to be continuous, is each continuous output segment going to be a cell in excel?
Just curious. It's easy enough to grab the information and print it with no spaces in between. Also, if you want excel to pick up your file output by just calling your text file whatever.xls, you should separate the different fields with a common excel separator (the ones they suggest when you import a text file) like a pipe (|) or comma (,). I've always used pipes and it's worked out well.

, Mike

As I said, check out the man pages for printf.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.