| | |
How to padd the words in unix script.... Help required
![]() |
•
•
Join Date: Oct 2006
Posts: 13
Reputation:
Solved Threads: 0
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
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
Madan Kumar T
Bangalore.
Bangalore.
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
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
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
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
As I said, check out the man pages for printf.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
Other Threads in the Shell Scripting Forum
- Previous Thread: Need help to padding the word to create flat files
- Next Thread: email log parsing
| Thread Tools | Search this Thread |






