Sponsored Content
Top Forums Shell Programming and Scripting NAWK: changing string-format with split Post 302559763 by regisl67 on Wednesday 28th of September 2011 05:13:05 AM
Old 09-28-2011
Uh?! It was so simple ... and works perfect. Thank you very much for your help! Régis
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Nawk Split

Hello. I have a input file in this format: line1data :: line1data :: line1data line2data :: line2data :: line2data I would like to split each lines data element into an array: array1=line1data array1=line1data array1=line1data array2=line2data array2=line2data array2=line2data I... (3 Replies)
Discussion started by: steveramsey
3 Replies

2. UNIX for Dummies Questions & Answers

Split BIG report using nawk

I have the following nawk script: nawk -F: '{ if($0 ~ "^Report No") {fl=1; i=0;} if(fl==1){data=$0; i++} if($0 ~ "^BE NO:") { fname = "reprot_"$2".lis"; gsub(" ","",fname); for(j=0;j<i;j++) print data > fname; fl=0; } else if(fl==0) print $0 > fname; }' filename When I try to apply... (1 Reply)
Discussion started by: raychu65
1 Replies

3. Shell Programming and Scripting

changing month in Mmm format to mm FORMAT

i have an variable mydate=2008Nov07 i want o/p as in variable mymonth=11 (i.e nov comes on 11 number month) i want some command to do this for any month without using any loop. plz help me (1 Reply)
Discussion started by: RahulJoshi
1 Replies

4. Shell Programming and Scripting

awk/nawk question to format a file

Hi, I am new to awk/nawk, needs help. I want to merge the rows having emplid attribute same into a single row in the following file. In actual this kind of file will have around 50k rows. Here is my input file id|emplid|firstname|dep|lastname 1|001234|test|1001|1 2|002345|test|1032|2... (7 Replies)
Discussion started by: kumar04
7 Replies

5. Shell Programming and Scripting

Format - Inventory Row data into Column - Awk - Nawk

Hi All, I have the following file that has computer data for various pcs in my network... Snap of the file is as follows ******************************************************************************* Serial 123456 Computer IP Address lo0:... (1 Reply)
Discussion started by: aavam
1 Replies

6. UNIX for Dummies Questions & Answers

Changing from Excel date format to MySQL date format

I have a list of dates in the following format: mm/dd/yyyy and want to change these to the MySQL standard format: yyyy-mm-dd. The dates in the original file may or may not be zero padded, so April is sometimes "04" and other times simply "4". This is what I use to change the format: sed -i '' -e... (2 Replies)
Discussion started by: figaro
2 Replies

7. Shell Programming and Scripting

how to parse the file in xml format using awk/nawk

Hi All, I have an xml file with the below format. <a>111</a><b>222</b><c>333<c><d><e>123</e><f>234</f><d><e>456</e><f>789</f> output needed is 111,222,333,123,234 111,222,333,456,789 nawk 'BEGIN{FS="<|>"} {print a,b,c,e,f a="" ... (7 Replies)
Discussion started by: natalie23
7 Replies

8. Shell Programming and Scripting

Nawk Format

Hi! I have a file which I want to search daily for any line that contains the work 'Reason' and I want to take that line and put the data in a certain format using awk or nawk....I do not have gawk on my machine so it would have to be awk or nawk, or sed would work as well. Here are some examples... (9 Replies)
Discussion started by: ther2000
9 Replies

9. Shell Programming and Scripting

Using awk or nawk to convert epoch time to date format

Looking for some help and usually when I do a search this site comes up. Hopefully someone can give me a little direction as to how to use one of these two commands to achieve what I'm trying to do. What am I trying to do? I need to take the time value in epoch format returned from the... (5 Replies)
Discussion started by: minigts
5 Replies

10. UNIX for Beginners Questions & Answers

Date format conversion how to change this from using nawk to awk

Hi, I have a file where I need to change the date format on the nth field from DD-MM-YYYY to YYYY-MM-DD so I can accurately sort the record by dates From regex - Use sed or awk to fix date format - Stack Overflow, I found an example using nawk. Test run as below: $: cat xyz.txt A ... (2 Replies)
Discussion started by: newbie_01
2 Replies
slock(9s)																 slock(9s)

NAME
slock - General: Contains simple lock-specific information SYNOPSIS
The slock data structure is an opaque data structure; that is, its associated members are referenced and manipulated by the operating sys- tem and not by the user of the simple lock method. Therefore, this reference page omits a description of the slock data structure's associ- ated members. DESCRIPTION
The slock data structure is the simple spin lock structure that contains simple lock-specific information. The user of the simple lock method declares a slock data structure by calling the decl_simple_lock_data routine. In subsequent calls to simple_lock, simple_lock_init, simple_lock_try, and simple_unlock, the caller passes the address of the previously declared slock data structure. NOTES
The header file <lock.h> shows typedef statements that assign the alternate name simple_lock_data_t for the simple spin lock structure and simple_lock_t for a pointer to the simple spin lock structure. FILES
SEE ALSO
Routines: decl_simple_lock_data(9r), simple_lock(9r), simple_lock_init(9r), simple_lock_terminate(9r), simple_lock_try(9r), sim- ple_unlock(9r) Data Structures: lock(9s) slock(9s)
All times are GMT -4. The time now is 07:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy