Sponsored Content
Top Forums Shell Programming and Scripting Print required values at end of the file by using AWK Post 302516031 by dvrbabu on Thursday 21st of April 2011 04:40:04 PM
Old 04-21-2011
This command works perfect for me. thank you very much. But I am looking all column values to create with tab delimited or comma(m)delimited in new file. When I try with below command its the values are not creating with tab delimited.

Code:
sed 's/.*|\([0-9]\{9\}\)|.*|\([0-9]\{9\}\)|\([0-9]\{8\}\)|.*/& \1 \2 \3/' '\t' input.fil > one.txt

Also I have two other input files that need to create with same . As I am new to SED I can't able to create sed by refering your command. Can you please check and provide sed command for below files too with tab delimited out put file.
Code:
Detail Id    Info Id    Order Id         STATUS    Status Date               File Detail
99191222     820308     CMOG224013751    PR        04-20-2011 07:00:27PM     20_R28|BQTBIZ_PRICEUP|776598279|776598280|20110420|C|Y7371-1|26342|Y7364|H7018-1|Y|N| 776598279 776598280 20110420
99191223     820308     CMOG224013767    PR        04-20-2011 07:00:31PM     20_R28|BQTBIZ_PRICEUP|772963162|772963163|20110420|C|Y7291-1|25525|Y2548|H7082-1|Y|N| 772963162 772963163 20110420

Code:
Detail Id    Info Id    Status    Status Date               File Detail            Error Code Error Desc
99191240     820308     ER        04-20-2011 07:01:25PM     20_R28|BQTBIZ_PRICEUP|16716056|16716059|20110420|C|G5935-1|6500|G6725|H7027-1|Y|N|           226113     Action is not allowed on a service with pending orders 16716056 16716059 20110420
99191489     820308     ER        04-20-2011 07:02:23PM     20_R28|BQTBIZ_PRICEUP|780442679|780442680|20110420|C|Y2516-1|25790|Y4490|H7094-1|Y|N|  780442679 780442680 20110420  

your help is greatly thank full.

---------- Post updated at 03:40 PM ---------- Previous update was at 11:58 AM ----------

any help for my request..

Last edited by Franklin52; 04-21-2011 at 03:47 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Urgent Help required : awk/sed help to find pattern and delete till end of line

Hi, I need help with using an awk or sed filter on the below line ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE Look for... (1 Reply)
Discussion started by: rajan_san
1 Replies

2. UNIX and Linux Applications

Print date at END clause of AWK

Hi to all! I 'm new in unix programing so... may be I decided a wrong tool to solve the problem but anyway... all road goes to rome jajaja. My question is: There is any way to print date at the END clause of an AWK script. I mean, I'm writing a tool with AWK and the results are redirected to a... (4 Replies)
Discussion started by: fmeriles
4 Replies

3. Shell Programming and Scripting

How to Print from matching word to end using awk

Team, Could some one help me in Printing from matching word to end using awk For ex: Input: I am tester for now I am tester yesterday I am tester tomorrow O/p tester for now tester yesterday tester tomorrow i.e Starting from tester till end of sentence (5 Replies)
Discussion started by: mallak
5 Replies

4. UNIX for Advanced & Expert Users

Awk to print values of second file

Hello, I have a data file with 300,000 records in it, and another file which contains only the line numbers of roughly 13,000 records in the data file which have data integrity issues. I'm trying to find a way to print the original data by line number identified in the second file. How can I do... (2 Replies)
Discussion started by: peteroc
2 Replies

5. Shell Programming and Scripting

awk, sed or perl regexp to print values from file

Hello all According to the following file (orignal one contains 200x times the same structure...) I was wondering if someone could help me to print <byte>??</byte> values example, running this script/command like ./script.sh xxapp I would expect as output: 102 116 112 ./script.sh xxapp2... (2 Replies)
Discussion started by: cabrao
2 Replies

6. Shell Programming and Scripting

Compare values in two files. For matching rows print corresponding values from File 1 in File2.

- I have two files (File 1 and File 2) and the contents of the files are mentioned below. - I am trying to compare the values of Column1 of File1 with Column1 of File2. If a match is found, print the corresponding value from Column2 of File1 in Column5 of File2. - I tried to modify and use... (10 Replies)
Discussion started by: Santoshbn
10 Replies

7. Shell Programming and Scripting

Required help to print diff columns for 2 patterns using awk

Hi All, I need help for below scenario : I have a principals.xml_24092012backup file : cat principals.xml_24092012backup </user> <user username="eramire" password="2D393C01720749256303D204826A374D9AE9ABABBF8A"> <roleMapping rolename="VIEW_EVERYTHING"/> </user> ... (2 Replies)
Discussion started by: kiran_j
2 Replies

8. Shell Programming and Scripting

awk one liner to print to end of line

Given: 1,2,whatever,a,940,sot how can i print from one particular field to the end of line? awk -F"," '{print $2 - endofline}' the delimiter just happens to be a comma "," in this case. in other cases, it could be hypens: 1---2---whatever---a---940---sot (4 Replies)
Discussion started by: SkySmart
4 Replies

9. Shell Programming and Scripting

awk to print line is values between two fields in separate file

I am trying to use awk to find all the $3 values in file2 that are between $2 and $3 in file1. If a value in $3 of file2 is between the file1 fields then it is printed along with the $6 value in file1. Both file1 and file2 are tab-delimited as well as the desired output. If there is nothing to... (4 Replies)
Discussion started by: cmccabe
4 Replies

10. Shell Programming and Scripting

Perl to extract values and print at end of each line

In the below perl I am trying to extract and print the values AF1=, the GT value, and F or QUAL diveded by 33 (rounded to the nearest whole #). The GT value is at the end after the GT:PL so all the possibilities are read into a hash h, then depending on the value that is in the line the... (1 Reply)
Discussion started by: cmccabe
1 Replies
UNEXPAND(1)								FSF							       UNEXPAND(1)

NAME
unexpand - convert spaces to tabs SYNOPSIS
unexpand [OPTION]... [FILE]... DESCRIPTION
Convert spaces in each FILE to tabs, writing to standard output. With no FILE, or when FILE is -, read standard input. Mandatory arguments to long options are mandatory for short options too. -a, --all convert all whitespace, instead of initial whitespace -t, --tabs=NUMBER have tabs NUMBER characters apart instead of 8 -t, --tabs=LIST use comma separated list of explicit tab positions --help display this help and exit --version output version information and exit AUTHOR
Written by David MacKenzie. REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>. COPYRIGHT
Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
The full documentation for unexpand is maintained as a Texinfo manual. If the info and unexpand programs are properly installed at your site, the command info unexpand should give you access to the complete manual. unexpand (coreutils) 4.5.3 February 2003 UNEXPAND(1)
All times are GMT -4. The time now is 09:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy