Sponsored Content
Top Forums Shell Programming and Scripting awk sed cut? to rearrange random number of fields into 3 fields Post 302311419 by axo959 on Tuesday 28th of April 2009 03:15:38 PM
Old 04-28-2009
Tools looks good

thank you, its looking good.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help with ksh/awk/sed script, random # of fields

Hello all, I'm working on an attendance callout script for a school district. I need to change our current layout for the vendor. Currently the data is in the form of: studentid,period,building, Heres a sample of some made up records: 500,1,30, 500,2,30, 500,3,30, 500,6,30,... (7 Replies)
Discussion started by: axo959
7 Replies

2. UNIX for Dummies Questions & Answers

count number of fields not using SED or AWK

hi forums i need help with a little problem i am having. i need to count the number of fields that are in a saved variable so i can use that number to make a different function work properly. is there a way of doing this without using SED/AWK? anything would be greatly appreciated (4 Replies)
Discussion started by: strasner
4 Replies

3. Shell Programming and Scripting

awk,cut fields by change field format

Hi Everyone, # cat 1.txt 1321631,77770132976455,19,20091001011859,20091001011907 1321631,77770132976455,19,20091001011859,20091001011907 1321631,77770132976455,19,20091001011859,20091001011907 # cat 1.txt | awk -F, '{OFS=",";print $1,$3,$4,$5}' 1321631,19,20091001011859,20091001011907... (7 Replies)
Discussion started by: jimmy_y
7 Replies

4. Shell Programming and Scripting

How to print 1st field and last 2 fields together and the rest of the fields after it using awk?

Hi experts, I need to print the first field first then last two fields should come next and then i need to print rest of the fields. Input : a1,abc,jsd,fhf,fkk,b1,b2 a2,acb,dfg,ghj,b3,c4 a3,djf,wdjg,fkg,dff,ggk,d4,d5 Expected output: a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
Discussion started by: 100bees
6 Replies

5. Shell Programming and Scripting

Using awk to rearrange fields

Hi, I am required to arrange columns of a file i.e make the 15th column into the 1st column. I am doing awk 'begin {fs=ofs=","} {print $15,$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14}' ad.data>ad.csv the problem is that column 15 gets to column 1 but it is not comma separated with the... (10 Replies)
Discussion started by: seddoubt
10 Replies

6. Shell Programming and Scripting

awk - compare 1st 15 fields of record with 20 fields

I'm trying to compare 2 files for differences in a selct number of fields. When differnces are found it will write the whole record of the second file including appending '|C' out to a delta file. Each record will have 20 fields, but only want to do comparison of 1st 15 fields. The 1st field of... (7 Replies)
Discussion started by: sljnk
7 Replies

7. Shell Programming and Scripting

awk sort based on difference of fields and print all fields

Hi I have a file as below <field1> <field2> <field3> ... <field_num1> <field_num2> Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields. I tried this and it doesn't sort on the difference field .. Appreciate your help. cat... (9 Replies)
Discussion started by: newstart
9 Replies

8. Shell Programming and Scripting

Pattern Match and Rearrange the Fields in UNIX

For an Output like below Input : <Subject A="I" B="1039502" C="2015-06-30" D="010101010101"> Output : <Subject D="010101010101" B="1039502" C="2015-06-30" A="I"> I have been using something like below but not getting the desired output : awk -F ' ' '/Subject/ BEGIN{OFS=" ";}... (19 Replies)
Discussion started by: arunkesi
19 Replies

9. Shell Programming and Scripting

Rearrange fields of delimited text file

I want to rearrange the fields of delimited text file after sorting first line (only): input file: a_13;a_2;a_1;a_10 13;2;1;10 the result should be: a_1;a_2;a_10;a_13 1;2;10;13 any help would be appreciated andy (20 Replies)
Discussion started by: andy2000
20 Replies

10. UNIX for Beginners Questions & Answers

Is there a UNIX command that can compare fields of files with differing number of fields?

Hi, Below are the sample files. x.txt is from an Excel file that is a list of users from Windows and y.txt is a list of database account. $ head -500 x.txt y.txt ==> x.txt <== TEST01 APP_USER_PROFILE USER03 APP_USER_PROFILE TEST02 APP_USER_EXP_PROFILE TEST04 APP_USER_PROFILE USER01 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
std::basic_ostream< _CharT, _Traits >::sentry(3)	     Library Functions Manual		  std::basic_ostream< _CharT, _Traits >::sentry(3)

NAME
std::basic_ostream< _CharT, _Traits >::sentry - SYNOPSIS
Public Member Functions sentry (basic_ostream< _CharT, _Traits > &__os) ~sentry () operator bool () const Detailed Description template<typename _CharT, typename _Traits = char_traits<_CharT>>class std::basic_ostream< _CharT, _Traits >::sentry Performs setup work for output streams. Objects of this class are created before all of the standard inserters are run. It is responsible for exception-safe prefix and suffix operations. Definition at line 400 of file ostream. Constructor &; Destructor Documentation template<typename _CharT, typename _Traits> std::basic_ostream< _CharT, _Traits >::sentry::sentry (basic_ostream< _CharT, _Traits > &__os) [explicit] The constructor performs preparatory work. Parameters: __os The output stream to guard. If the stream state is good (__os.good() is true), then if the stream is tied to another output stream, is.tie()->flush() is called to synchronize the output sequences. If the stream state is still good, then the sentry state becomes true (okay). Definition at line 47 of file ostream.tcc. References std::ios_base::failbit, std::basic_ios< _CharT, _Traits >::good(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_ios< _CharT, _Traits >::tie(). template<typename _CharT, typename _Traits = char_traits<_CharT>> std::basic_ostream< _CharT, _Traits >::sentry::~sentry () [inline] Possibly flushes the stream. If ios_base::unitbuf is set in os.flags(), and std::uncaught_exception() is true, the sentry destructor calls flush() on the output stream. Definition at line 428 of file ostream. References std::ios_base::badbit, std::uncaught_exception(), and std::ios_base::unitbuf. Member Function Documentation template<typename _CharT, typename _Traits = char_traits<_CharT>> std::basic_ostream< _CharT, _Traits >::sentry::operator bool () const [inline], [explicit] Quick status checking. Returns: The sentry state. For ease of use, sentries may be converted to booleans. The return value is that of the sentry state (true == okay). Definition at line 449 of file ostream. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ Tue Jun 10 2014 std::basic_ostream< _CharT, _Traits >::sentry(3)
All times are GMT -4. The time now is 04:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy