03-03-2009
Flat File column manipulation
Hi All,
I have a tab delimited input file with say 4 fields (columns) as below :
0000443 1AGPR061 2006 Daiml
0002198 1B3XG0K2 1989 Chdds
0002199 1Bd64J0L 1990 Ch34s
0002275 1B3s4J0K 1989 Chadys
0002276 1B465302 2002 Dageml
0002290 1B45430K 1989 Cays
I want the 2nd column in file to be replaced with only first 2 chars and 6th char of the 2nd column values, so output should look like :
0000443 1A0 2006 Daiml
0002198 1B0 1989 Chdds
0002199 1BJ 1990 Ch34s
0002275 1BJ 1989 Chadys
0002276 1B3 2002 Dageml
0002290 1B3 1989 Cays
Can anyone help me with this
?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Here is on more go ! Need a shortcut for my problem !
problem is i have a look_update with fixed sequence of column
that is :
MANDT:SERAIL:SERSCHA:SEREX:EQTYP:BSTVP
I will be getting data in a flat file having same number of column but the sequence could be different in each... (5 Replies)
Discussion started by: jambesh
5 Replies
2. Shell Programming and Scripting
Howdy everyone, I have need of a scripting brain to help me through the following issue:
*This will help if I explain what I am doing this for and then it may make sense.
I need to change a flat file to prepend a 3 digit code to a certain field in the file going on the value in another scetion of... (2 Replies)
Discussion started by: mrbungle50
2 Replies
3. Shell Programming and Scripting
Hi,
Request To guide me in writing a shell program for the following requirement:
Example:if the Input File contains the follwing data
Input File Data:
80723240029,12,323,443,88,98,7,98,67,87
80723240030,12,56,6,,,3,12,56,6,7,2,3,12,56,6,7,2,3,88,98,7,98,67,87... (5 Replies)
Discussion started by: srinikal
5 Replies
4. Shell Programming and Scripting
Hi
I have flat file with 100 records ,I need to fabricate data into flat file .
ex:
file.txt
102345 1000 200 300
...............................
..............................
102346 2000 300 4000
In above file the 4th row, 1 st column valu to be increment by 1
and rest of... (13 Replies)
Discussion started by: mohan705
13 Replies
5. Shell Programming and Scripting
I have one flat file like below
id1~col~batch1
id2~col2~batch2
id3~col3~batch3
I need to read the first column one by one and I need to write one db2 query based on that column1
Like
for (i=0;i<=10;i++)
do
insert into table column (con_id) values (select column from table where... (4 Replies)
Discussion started by: siri_886
4 Replies
6. Shell Programming and Scripting
Hello Guys
Please find my below requirement
I have a flat file with column headers in first line and data
The structure like below
col1 col2 col3
A 1 2
B 3 4
C 5 6
Say I have to take the summation of col2 (that will depend on the... (2 Replies)
Discussion started by: Pratik4891
2 Replies
7. Shell Programming and Scripting
Hello Guys
I want to sort a flat file by the third column (numeric ) and store it in some other name
I/P
9924873|20111114|00000000000013013|130|13|10/15/2010 12:36:22|W860944|N|00
9924873|20111114|00000000000013009|130|09|10/15/2010 12:36:22|W860944|N|00... (12 Replies)
Discussion started by: Pratik4891
12 Replies
8. Shell Programming and Scripting
Hi,
Let say I have a file which has around 400 fields.
SampleFile
=========
PATIENTID|FACILITY|................|TIME_LAST_VISITED_BY_MD|.....|STATUS|
How is it possible to find out which field is TIME_LAST_VISITED_BY_MD?fro example by seeing the above structure we can saw FACILITY... (5 Replies)
Discussion started by: machomaddy
5 Replies
9. UNIX for Advanced & Expert Users
In a space delimited file how would you go about removing 2 and 3 column of a file and add "word" to the first column of the file in both awk and vi? (2 Replies)
Discussion started by: cokedude
2 Replies
10. Shell Programming and Scripting
Hello, I have a large flat file where i need to change data in columns 131-133 based on what is in columns 172-173. I am not sure if I need to read the file line by line and make the change or if I can do this in a single statement. thank you (3 Replies)
Discussion started by: gblmin
3 Replies
LEARN ABOUT ULTRIX
g3topbm
g3topbm(1) General Commands Manual g3topbm(1)
NAME
g3topbm - convert a Group 3 fax file into a portable bitmap
SYNOPSIS
g3topbm [-kludge] [-reversebits] [-stretch] [g3file]
DESCRIPTION
Reads a Group 3 fax file as input. Produces a portable bitmap as output.
OPTIONS
-kludge
Tells g3topbm to ignore the first few lines of the file; sometimes fax files have some junk at the beginning.
-reversebits
Tells g3topbm to interpret bits least-significant first, instead of the default most-significant first. Apparently some fax modems
do it one way and others do it the other way. If you get a whole bunch of "bad code word" messages, try using this flag.
-stretch
Tells g3topbm to stretch the image vertically by duplicating each row. This is for the low-quality transmission mode.
All flags can be abbreviated to their shortest unique prefix.
REFERENCES
The standard for Group 3 fax is defined in CCITT Recommendation T.4.
BUGS
Probably.
SEE ALSO
pbmtog3(1), pbm(5)
AUTHOR
Copyright (C) 1989 by Paul Haeberli <paul@manray.sgi.com>.
02 October 1989 g3topbm(1)