Sponsored Content
Top Forums Shell Programming and Scripting Change in Input feed based on condition file Post 302446908 by varunrbs on Friday 20th of August 2010 06:21:01 AM
Old 08-20-2010
1 record in single line without any newline character

Sorry for my earlier message. In Unix File 1 record is in 1 line only. There is no newline character in the single record. However while displaying it takes 3 lines.

Also the above solution seems to be in Perl, can't it be done using sed or awk ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search file, change existing value based on input (awk help)

I have a file (status.file) of the form: valueA 3450 valueB -20 valueC -340 valueD 48 I am tailing a data.file, and need to search and modify a value in status.file...the tail is: tail -f data.file | awk '{ print $3, ($NF - $(NF-1)) }' which will produce lines that look like this: ... (3 Replies)
Discussion started by: nortonloaf
3 Replies

2. Shell Programming and Scripting

Awk to print on condition in input file

I need only those records which has $2 equal to "DEF" independent of case (i.e upper or lower) nawk -F"," '$2 ~ //{print $0}' file This returns 3rd record also which i dont want I tried this but this doesnt work as expected. nawk -F"," '$2 == ""{print $0}' file i dont... (3 Replies)
Discussion started by: pinnacle
3 Replies

3. Shell Programming and Scripting

Copy input file based on condition

Hi, I am new to unix shell programming. I want to write a shell script for a functionality existing in mainframe system. I have one file as below as input 123456 &__987 &12yuq abcdef _ referes to blank condition:whenever the input file is having &__ ,it should be replaced... (4 Replies)
Discussion started by: charan0703
4 Replies

4. Shell Programming and Scripting

Move input file based on condition

Hello, I have File1 in a directory A, a File2 in a directory B. If the File2 is not empty Then I have to move File1 from directory A to a directory archive Else no action. Is it possible to do this from one command line? Thank you in advance for your answers. Madi (2 Replies)
Discussion started by: AngelMady
2 Replies

5. Shell Programming and Scripting

How can I change file value based on condition

Hi, Gurus, I got a problem to resolve following issue: I have one file file1as following: start_dt=2010-01-01 12:00:02 start_dt=2011-01-01 09:00:02 start_dt=2009-01-01 11:00:02I have another file file2 as following: title1, 2010-01-03 10:00:02 title2, 2011-01-04 11:00:02 title3,... (5 Replies)
Discussion started by: ken002
5 Replies

6. UNIX for Dummies Questions & Answers

Feed Input to a script running on bash

Hi Sir, I am just learning bash scripting and I came across a challenge. I need to input F11 to a script among many text inputs. For all the text inputs i did following. # sh test.sh < input.txt where input.txt contains all the text inputs in new lines. This worked fine until i... (1 Reply)
Discussion started by: gaurav kumar
1 Replies

7. Shell Programming and Scripting

Script to select the rows from the feed file based on the input value provided

Hi Folks, I have the below feed file named abc1.txt in which you can see there is a title and below is the respective values in the rows and it is completely pipe delimited file ,. ... (3 Replies)
Discussion started by: punpun66
3 Replies

8. Shell Programming and Scripting

awk to change contents of field based on condition in same file

In the awk below I am trying to copy the entire contents of $6 there may be multiple values seperated by a ;, to $8, if $8 is . (lines 1 and 3 are examples). If that condition $8 is not . (line2 is an example) then that line is skipped and printed as is. The awk does execute but prints the output... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. UNIX for Beginners Questions & Answers

Change the field color based on condition in email

Request your help to change the field color based on condition , if it is otherthan 0. using html in unix. Here is my condition for(i=1;i<=NF;i++) { print "<td> "$i"</td> } Please use CODE tags when displaying sample input, output, and code segments. (17 Replies)
Discussion started by: CatchMe
17 Replies

10. UNIX for Beginners Questions & Answers

awk to add +1 to value based on condition in input

In the awk below I am trying to add a | that will adjust $2 in the ouput by adding +1 if the original value from file that was used in $3 had a - in it. Line 3 of file is an example of this. In my current awk I just subtract one but I am not sure how to only apply this to those values without a -.... (5 Replies)
Discussion started by: cmccabe
5 Replies
NKF(3)							User Contributed Perl Documentation						    NKF(3)

NAME
NKF - Perl extension for Network Kanji Filter SYNOPSIS
use NKF; $output = nkf("-s",$input); DESCRIPTION
This is a Perl Extension version of nkf (Netowrk Kanji Filter ) 1.7. It converts the last argument and return converted result. Conversion details are specified by flags before the last argument. Flags: "b,u Output is bufferred (DEFAULT),Output is unbufferred" "j,s,e Outout code is JIS 7 bit (DEFAULT), Shift JIS, AT&T JIS (EUC)" "J,S,E Input assumption is JIS 7 bit , Shift JIS, AT&T JIS (EUC)" "t no conversion" "i_ Output sequence to designate JIS-kanji (DEFAULT B)" "o_ Output sequence to designate ASCII (DEFAULT B)" "r {de/en}crypt ROT13/47" "m[BQ] MIME decode [B:base64 stream,Q:quoted stream]" "l ISO8859-1 (Latin-1) support" "f Folding: "-f60" or "-f"" "Z[0-2] Convert X0208 alphabet to ASCII 1: Kankaku to space,2: 2 spaces" "X,x Assume X0201 kana in MS-Kanji, "-x" preserves X0201" "B[0-2] Broken input 0: missing ESC,1: any X on ESC-[($]-X,2: ASCII on NL" "d,c Delete in line feed, Add in line feed" "m0 No MIME decode." "M MIME encode. Header style. All ASCII code and control characters are intact." "MB MIME encode. Base64 stream. Kanji conversion is performed before encoding, so this cannot be used as a picture encoder." "l Input and output code is ISO8859-1 (Latin-1) and ISO-2022-JP." "L[wmu] new line mode" " -Lu unix (LF) " " -Lw windows (CRLF) " " -Lm mac (CR) " " --fj,--unix,--mac,--msdos, --windows convert for these system" " --jis,--euc,--sjis,--mime,--base64 convert for named code" " --jis-input,--euc-input,--sjis-input,--mime-input,--base64-input assume input system" " -- ignore rest of -option" " --help" " --version" AUTHOR
Network Kanji Filter Version 1.9 (2/0002/Shinji Kono) Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa),1998 S. Kono, COW SEE ALSO
perl(1). nkf(1) perl v5.12.1 2005-04-09 NKF(3)
All times are GMT -4. The time now is 09:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy