Sponsored Content
Full Discussion: Awk: Data Insert
Top Forums Shell Programming and Scripting Awk: Data Insert Post 302334581 by summer_cherry on Thursday 16th of July 2009 03:50:57 AM
Old 07-16-2009
perl:
Code:
while(<DATA>){
	chomp;
	if (/^(FA|AT|MI|SD|PM)R:/){
		print "\n" ;
		if(/^MIR:/){
			my @tmp=split("[|]",$_,11);
			@tmp[1,9]=('TEST','25');
			print join "|", @tmp;
		}
		else{
			print $_;
		}
	}
	else{
		print "$_";
	}
}
__DATA__
FAR:A|4|2
ATR:12:21:05 5-Jul-2009|
/image/bin.rls/stdf_repair XXX_TCS5B_WS2_R03_09Jul05_
09_48.stdf 
MIR:3UPF22030.1||TCS5B Probe|T09-J750|J750|
||||||||||SG|||||||T09-J750
SDR:1|0|0,1|Prober|H05|ProbeCard|P02||TCS5B_WS2_R03|0|0
PMR:256|768|2|C10, k4.8, k3.5|AVDD|1|0
PMR:256|768|5|C10, k4.8, k3.5|AVDD|1|1

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed, insert data from a file to another?

Hello, I have 2 files. File1 has data I wrote, and File2 is a file created by an application. I would like to insert the data from File1 into File2, but it has to be inserted at a certain location on File2. I know I need to search for "</jsp-param> </jsp-descriptor>" But I don't know... (4 Replies)
Discussion started by: ctcuser
4 Replies

2. UNIX for Dummies Questions & Answers

help me to to insert data

hi, am new to unix can any one help me to insert data to afile to a specified column. ie to an output file with csv format i should insert some data to 2,3,4 fileds and the data in those fields should move to next fields eg: output file asd,12,12,12,12,1,2,1,1,1,1,1... (10 Replies)
Discussion started by: babu@shell
10 Replies

3. Solaris

Not able to insert data

Hi All, I enhanced a perl script that creates a table with xyz_yyyymm and insert data from xyz table before truncate xyz.I have tested it successfully in dev but when i ran it on production new table xyz_yyyymm created but did not insert any records from xyz.(No errors were thrown)The perl... (1 Reply)
Discussion started by: megh
1 Replies

4. Shell Programming and Scripting

How to insert data befor some field in a row of data depending up on values in row

Hi I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example. The original data record should be some thing like this 60119827 RTMS_LOCATION_CDR INSTANT_POSITION_QUERY 1236574686123083rtmssrv7 ... (8 Replies)
Discussion started by: aemunathan
8 Replies

5. Shell Programming and Scripting

Insert and shifting data at column

Hi all, i have data like this joe : 1 :a bob : 2 :b sue : 3 :c foo : 4 :d at column 2 i want to insert TOP to the top column and at column 3 i want to insert BOTTOM to the bottom column. and the result will... (12 Replies)
Discussion started by: psychop13
12 Replies

6. Shell Programming and Scripting

How to insert gaussian noise to a data with an order with awk?

Hello everybody, My problem is inserting gaussian noise to a file containing data, that is, add every single noise to the number after every 6 character. here is my data 0910 1 2048 32.38 40 20.88 28 35.53 9.62 0.00 MSDMP0 1.790MSDMS1 2.840KCTXP2 4.400KRCMP0 4.600BOZMP0 5.640BOZMS2... (26 Replies)
Discussion started by: miriammiriam
26 Replies

7. UNIX for Dummies Questions & Answers

How to insert data in a file at last?

Hi Am Using Unix ksh... I have file name called FILE1 Have a content in a FILE as 11/01/2012 12/07/2012 -- -- I have used one variable DATE=12/11/2012 I wants to insert DATE variable value at last line in a file I need Output as cat FILE1 11/01/2012 12/07/2012 -- (2 Replies)
Discussion started by: Venkatesh1
2 Replies

8. Shell Programming and Scripting

Parsing XML (and insert data) then output data (bash / Solaris)

Hi folks I have a script I wrote that basically parses a bunch of config and xml files works out were to add in the new content then spits out the data into a new file. It all works - apart from the xml and config file format in the new file with XML files the original XML (that ends up in... (2 Replies)
Discussion started by: dfinch
2 Replies

9. Programming

Need help on Insert data to mySQL database

Hi guys, I would like to seek help on inserting data whenever the switch is on or off to my sensor mySQL database in phpMyAdmin from my control.php. I'm using Raspberry PI as my hardware and follow a few tutorials to create my own Web Control Interface, it works perfectly without insert method.... (1 Reply)
Discussion started by: aoiregion
1 Replies

10. Shell Programming and Scripting

Insert data based on pattern

if it is finding some data based on pattern 'test' then insert else if has no data based on the pattern 'test' then exit successfully cat file | grep test > file2 (3 Replies)
Discussion started by: jagu
3 Replies
PCSC_SCAN(1)						      General Commands Manual						      PCSC_SCAN(1)

NAME
pcsc_scan - regularly scans every PC/SC readers connected to the host SYNOPSIS
pcsc_scan [options] DESCRIPTION
This manual page documents briefly the pcsc_scan command. pcsc_scan is a program that regularly scans every PC/SC readers connected to the host When pcsc_scan is started it asks pcscd the list of available smart card readers. The list is printed. A sequence number is printed before each reader. Example: PC/SC device scanner V 1.1.0 (c) 2001-2002, Ludovic Rousseau PC/SC lite version: 1.1.1 0: GemPC410 0 0 1: GemPC430 0 0 When a card is inserted in any reader some information is printed: date and time: Thu Jun 13 18:56:14 2002 reader name: Reader 0 (GemPC410 0 0) card state and occured event: Card state: State has changed, Card inserted, ATR in case of card insertion: ATR: 3B 82 00 86 1E print an ATR analysis if the ATR_analysis command is available: ATR: 3B 82 00 86 1E + TS = 3B --> Direct Convention + T0 = 82, Y(1): 1000, K: 2 (historical bytes) TD(1) = 00 --> Y(i+1) = 0000, Protocol T = 0 ----- + Historical bytes: 86 1E OPTIONS
-h print help -V print version number -n do not print ATR analysis SEE ALSO
pcscd(1), ATR_analysis(1) AUTHOR
Ludovic Rousseau <ludovic.rousseau@free.fr> june 13, 2002 PCSC_SCAN(1)
All times are GMT -4. The time now is 05:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy