Sponsored Content
Full Discussion: awk - make new line
Top Forums Shell Programming and Scripting awk - make new line Post 302859795 by sea on Thursday 3rd of October 2013 10:00:24 PM
Old 10-03-2013
Try:
Code:
STRING="When you post an item you can just delete the files."
WORDS=0
for WORD in $STRING;do
    printf "$WORD "
    let WORDS++ ; [[ $WORDS -gt 2 ]] && WORDS=0
    [[ $WORDS -eq 0 ]] && printf "\n"
done
printf "\n"

EDIT: Sorry just figured you're refering to awk, which i dont know either.

Last edited by sea; 10-03-2013 at 11:36 PM.. Reason: codefix ;)
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to make all lines into 1 line?

I have a file listing IP addresses, 1 per line, such as: 1.2.3.4 3.4.5.6 12.13.14.15 7.8.9.6 I want all of the entries to be on the same line, and quoted, such as: "1.2.3.4" "3.4.5.6" "12.13.14.15" "7.8.9.6" I got the quotes on there in vi with ":%s/^/"/g" and "%s/$/"/g" ... is there... (8 Replies)
Discussion started by: earnstaf
8 Replies

2. Shell Programming and Scripting

to make 2 lines into 1 line using awk

suppose i have a file AAAHHHHAHH AJJJJAAAAAA AJJJJJAAJJAK AJJAJJAJKKK the output suhd be AAAHHHHAHHAJJJJAAAAAAAJJJJJAAJJAKAJJAJJAJKKK (2 Replies)
Discussion started by: cdfd123
2 Replies

3. Linux

how to enable #ifdef macro in the command line of make?

Linux, C++, make, macro In source code, we used some #ifdef macros. How can I enable #ifdef macro in the command line of "make" (NOTE: I do NOT want to change source code or makefile to define that macro from time to time). e.g. test.cpp: ... #ifdef TEST1 // code segment for test1 ...... (3 Replies)
Discussion started by: princelinux
3 Replies

4. Shell Programming and Scripting

make multiple line containing a pattern into single line

I have the following data file. zz=aa azxc-1234 aa=aa zz=bb azxc-1234 bb=bb zz=cc azxc-1234 cc=cc zz=dd azxc-2345 dd=dd zz=ee azxc-2345 ee=ee zz=ff azxc-3456 ff=ff zz=gg azxc-4567 gg=gg zz=hh azxc-4567 hh=hh zz=ii azxc-4567 ii=ii I want to make 2nd field pattern matching multiple lines... (13 Replies)
Discussion started by: VTAWKVT
13 Replies

5. Shell Programming and Scripting

Try to make a single line to syslog.

Hi again: Following the thread: https://www.unix.com/shell-programming-scripting/147755-format-lines-file.html I couldn't solve my problem, so I ask you again gurus: I have this code: nohup /usr/sbin/auditstream | /usr/sbin/auditselect -m -e "event== S_ENVIRON_WRITE || event==... (2 Replies)
Discussion started by: iga3725
2 Replies

6. Shell Programming and Scripting

How to make command line interactive?

I have a file with stats for different month, I use the cat and grep combination to search for different month. cat <file> | grep "April" cat <file> | grep "May" cat <file> | grep "June" etc. How do you make this command interactive. So that I can give the values for the search. Thanks... (7 Replies)
Discussion started by: purelltab
7 Replies

7. UNIX for Dummies Questions & Answers

search all file for particular text and make changes to line 3

Hi All, I am sitting on HPUX. I want to change the exit into #exit, which appears into 3red line of code in shell scripting, wondering how shell script to be called up to perform action. I have following code in all files. Now, I need to find the text exit and replace into #exit. #!/sbin/sh... (10 Replies)
Discussion started by: alok.behria
10 Replies

8. Shell Programming and Scripting

search between keywords and make a single line

have a very big file where need to format it like below example file: abcd today is great day; search keyword 'abcd' and append to it all words till we reach ; to make it a single line. output should look like. abcd today is great day; There are many occurrence of such... (2 Replies)
Discussion started by: giri4332
2 Replies

9. Shell Programming and Scripting

Make Multile line is one line using window Perl

Hi All I have a .csv file which is showing data as ESP Client,ESP Engagement,Misc_Projects_120101,DEFAULT,HA,Unknown,No,Unknown,201704,4.1,Unknown,AAA,Collected-Done,"she,joy.",200111,Unknown,Full Time,,Delivery_DONE AMO,Approved,2012-12-03,2012-12-06,2012-12-06,"Occupied Hours ... (7 Replies)
Discussion started by: adisky123
7 Replies

10. Shell Programming and Scripting

How to make a new line of the file?

Hi, I have a file (newfile.txt) with the contents below: This is a new file. This is a new file. This is a new file. This is a new file. How could I make a new line of the file as below? This is a new file. This is a new file. This is a new file. This is a new file. When there is a... (12 Replies)
Discussion started by: khchong
12 Replies
GJITEN(1)						      General Commands Manual							 GJITEN(1)

NAME
gjiten - Japanese dictionary for Gnome SYNOPSIS
gjiten [ option ] DESCRIPTION
gjiten is a Japanese dictionary for the Gnome Desktop. It also has a kanji dictionary; any combination of stroke number, radicals and search key can be used for kanji lookups. Requires dictionary files in edict format and a working X Input Method (e.g. kinput2) for Japa- nese input. This manpage only explains the command line options. You should be able to access the complete documentation from the Help menu. OPTIONS
-c and -v are convenient for fast lookups via keyboard shortcuts. -k Same as --kanjidic --kanjidic Only show the KanjiDic window on startup. -w WORD Same as --word-lookup=WORD --word-lookup=WORD Look up WORD on startup. -l KANJI Same as --kanji-lookup=KANJI --kanji-lookup=KANJI Look up Kanji on startup in KanjiDic. -c Same as --clip-kanji --clip-kanji Look up kanji from the clipboard. -v Same as --clip-word --clip-word Look up word from the clipboard. --version Prints the version of gjiten BUGS
See the BUGS file for a list of bugs. The TODO file is more likely to contain these. Please contact me if you encounter any bugs. SEE ALSO
xjdic(1) AUTHORS
Botond Botyanszki (boti@rocketmail.com) 20 Jun 2002 GJITEN(1)
All times are GMT -4. The time now is 11:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy