Sponsored Content
Top Forums Shell Programming and Scripting Search and remove in a text file Post 302383229 by Scott on Tuesday 29th of December 2009 12:09:05 AM
Old 12-29-2009
Based on your input (name in field 2 of a semi-colon-delimited file)
Code:
read NAME
awk -F";" '
  $2 != NAME
' NAME="$NAME" input_file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove specified text from file

I am trying to write a script that kills old sessions, I've posted here over the past few days and the script is just about perfect except I want to be given the option to exclude specified PIDs from being killed. this is the entire script: if then rm /tmp/idlepids fi if then rm... (2 Replies)
Discussion started by: raidzero
2 Replies

2. UNIX for Dummies Questions & Answers

search and replace a specific text in text file?

I have a text file with following content (3 lines) filename : output.txt first line:12/12/2008 second line:12/12/2008 third line:Y I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before. I tried using cat output.txt... (4 Replies)
Discussion started by: santosham
4 Replies

3. Shell Programming and Scripting

Search text from a file and print text and one previous line too

Hi, Please let me know how to find text and print text and its previous line. Please don't get irritated few days back I asked text and next line. I am using HP-UX 11.11 Thanks for your help. (6 Replies)
Discussion started by: kamranjalal
6 Replies

4. Shell Programming and Scripting

Search and Remove Lines within File

Hello, I've searched through the scripting section but could not find what I need. I need to search for empty sections within a file and remove them. Here is an example file: Title 123 A B C D E Title 098 Title 567 Z Y (4 Replies)
Discussion started by: leepet01
4 Replies

5. Shell Programming and Scripting

Search based on 1,2,4,5 columns and remove duplicates in the same file.

Hi, I am unable to search the duplicates in a file based on the 1st,2nd,4th,5th columns in a file and also remove the duplicates in the same file. Source filename: Filename.csv "1","ccc","information","5000","temp","concept","new" "1","ddd","information","6000","temp","concept","new"... (2 Replies)
Discussion started by: onesuri
2 Replies

6. Shell Programming and Scripting

search text file in file if this file contains necessary text (awk,grep)

Hello friends! Help me pls to write correct awk and grep statements for my task: I have got files with name filename.txt It has such structure: Start of file FROM: address@domen.com (12...890) abc DATE: 11/23/2009 on Std SUBJECT: any subject End of file So, I must check, if this file... (4 Replies)
Discussion started by: candyme
4 Replies

7. Shell Programming and Scripting

How to search multiple patterns and remove lines from a file?

Hi, I have a file content as below. Table : PAYR Displayed fields: 15 of 15 Fixed columns: 4 List width 0999... (4 Replies)
Discussion started by: shirdi
4 Replies

8. Shell Programming and Scripting

Read in search strings from text file, search for string in second text file and output to CSV

Hi guys, I have a text file named file1.txt that is formatted like this: 001 , ID , 20000 002 , Name , Brandon 003 , Phone_Number , 616-234-1999 004 , SSNumber , 234-23-234 005 , Model , Toyota 007 , Engine ,V8 008 , GPS , OFF and I have file2.txt formatted like this: ... (2 Replies)
Discussion started by: An0mander
2 Replies

9. Shell Programming and Scripting

Search a text and return the text from file

Hi I have a set of input strings in a pattern as given below string1 string2 string3 string4 string5 I need to search this sequence of strings from a file in such a way that the first two strings (string1 and string2) and last two strings (string4 and string5) should match with the... (8 Replies)
Discussion started by: my_Perl
8 Replies

10. Shell Programming and Scripting

How to remove the text between all curly brackets from text file?

Hello experts, I have a text file with lot of curly brackets (both opening { & closing } ). I need to delete them alongwith the text between opening & closing brackets' pair. For ex: Input:- 59. Rh1 Qe4 {(Qf5-e4 Qd8-g8+ Kg6-f5 Qg8-h7+ Kf5-e5 Qh7-e7+ Ke5-f5 Qe7-d7+ Qe4-e6 Qd7-h7+ Qe6-g6... (6 Replies)
Discussion started by: prvnrk
6 Replies
CSV2MIPE(1)						User Contributed Perl Documentation					       CSV2MIPE(1)

NAME
csv2mipe.pl - Generates MIPE file based on 3 tab-delimited files based on MIPE version v1.1 arguments: * tab-delimited file with PCR-level data * tab-delimited file with SNP-level data * tab-delimited file with assay-level data Columns in file with PCR-level data: pcr_id pcr_modified (might be multiple, divided by semi-colon ";") pcr_project (might be multiple, divided by semi-colon ";") pcr_researcher (might be multiple, divided by semi-colon ";") pcr_species source_type source_id design_seq primer1_oligo primer1_seq primer1_tm primer2_oligo primer2_seq primer2_tm design_remark (might be multiple, divided by semi-colon ";") use_seq use_revcomp use_remark (might be multiple, divided by semi-colon ";") pcr_remark (might be multiple, divided by semi-colon ";") Columns in file with SNP-level data: pcr_id snp_id snp_pos snp_amb snp_remark (might be multiple, divided by semi-colon ";") Columns in file with assay-level data: pcr_id snp_id assay_id assay_type assay_enzyme assay_oligo assay_specific assay_tail assay_strand assay_remark (might be multiple, divided by semi-colon ";") SYNOPSIS
csv2mipe.pl <pcr_file.csv> <snp_file.csv> <assay_file.csv> ADDITIONAL INFO
See http://mipe.sourceforge.net AUTHOR
Jan Aerts (jan.aerts@bbsrc.ac.uk) perl v5.14.2 2005-07-20 CSV2MIPE(1)
All times are GMT -4. The time now is 07:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy