Sponsored Content
Top Forums Shell Programming and Scripting [Solved] How to separate one line to mutiple line based on certain number of characters? Post 302817197 by ken6503 on Wednesday 5th of June 2013 11:00:22 AM
Old 06-05-2013
[Solved] How to separate one line to mutiple line based on certain number of characters?

hi Gurus,

I need separate a file which is one huge line to multiple lines based on certain number of charactors. for example:
Code:
abcdefghi high abaddffdd

I want to separate the line to multiple lines for every 4 charactors.
the result should be
Code:
abcd
efgh
i hi
gh a
badd
ffdd

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extracting a line based on line number

i want to cut all the entries from the /etc/passwd file in which the uid is> 500 for this i was writing this ,m quiet new to all this.. scripting but on the 6th n 8th line ,, i hav to specify a line number .. to get the commnd working .. but i want to use variable i instead of that ,,... (2 Replies)
Discussion started by: narendra.pant
2 Replies

2. Shell Programming and Scripting

Display mutiple line in single line

Hi All, I had a file called Input.txt, i need to group up in a single line as 1=ttt and the no of lines may vary bewteen the 1=ttt cat Input.txt 1=ttt,2=xxxxxx, 3=4545 44545, 4=66667 7777, 5=77723 1=ttt, 2=xxxxxx, 3=34436 66 3545, 4=66666, 5=ffffff, 6=uuuuuuu 1=ttt, 2=xxxxxx,... (4 Replies)
Discussion started by: manosubsulo
4 Replies

3. Shell Programming and Scripting

Maximum number of characters in a line.

Hi, Could any one please let me know what is the maximum number of characters that will fit into a single line of a flat file on a unix. Thanks. (1 Reply)
Discussion started by: Shivdatta
1 Replies

4. Shell Programming and Scripting

Print selection of line based on line number

Hi Unix gurus Basically i am searching for the pattern and getting the line numbers of the grepped pattern. I am trying to print the series of lines from 7 lines before the grepped line number to the grepped line number. I am trying to use the following code. but it is not working. cat... (3 Replies)
Discussion started by: mohanm
3 Replies

5. Shell Programming and Scripting

help: Awk to control number of characters per line

Hello all, I have the following problem: My input is two sorted files: file1 >1_19_130_F3 T01220131330230213311013000000110000 >1_23_69_F3 T01200211300200200010000001000000 >1_24_124_F3 T010203113002002111111200002010 file2 >1_19_130_F3 24 18 9 18 23 4 11 4 5 9 5 8 15 20 4 4 7 4... (9 Replies)
Discussion started by: DerSeb
9 Replies

6. Shell Programming and Scripting

[Solved] Problem in reading a file line by line till it reaches a white line

So, I want to read line-by-line a text file with unknown number of files.... So: a=1 b=1 while ; do b=`sed -n '$ap' test` a=`expr $a + 1` $here do something with b etc done the problem is that sed does not seem to recognise the $a, even when trying sed -n ' $a p' So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies

7. Shell Programming and Scripting

Limit on Number of characters in a line - Vi editor

In the vi editor, there seems to be some limit on the number of characters could be allowed in single line. I tried a line with characters up to 1880. It worked. But when i tried with something of 5000 characters, it doesnt work. Any suggestions. Thanks in advance! (2 Replies)
Discussion started by: nram_krishna@ya
2 Replies

8. Shell Programming and Scripting

[Solved] making each word of a line to a separate line

Hi, I have a line which has n number of words with separated by space. I wanted to make each word as a separate line. for example, i have a file that has line like i am a good boy i want the output like, i am a good (8 Replies)
Discussion started by: rbalaj16
8 Replies

9. UNIX for Dummies Questions & Answers

using sed delete a line from csv file based on specific data in two separate fields

Hello, :wall: I have a 12 column csv file. I wish to delete the entire line if column 7 = hello and column 12 = goodbye. I have tried everything that I can find in all of my ref books. I know this does not work /^*,*,*,*,*,*,"hello",*,*,*,*,"goodbye"/d Any ideas? Thanks Please... (2 Replies)
Discussion started by: Chris Eagleson
2 Replies

10. Shell Programming and Scripting

How to separate one line to mutiple line based on one char?

Hi Gurus, I need separate one file which is one huge line to mutiple line. file like abcd # bcd # def # fge # ged I want to get abcd bcd def fge ged Thanks in advance (4 Replies)
Discussion started by: ken6503
4 Replies
IRSEND(1)								FSF								 IRSEND(1)

NAME
irsend - basic LIRC program to send infra-red commands SYNOPSIS
irsend [options] DIRECTIVE REMOTE CODE [CODE...] DESCRIPTION
Asks the lircd daemon to send one or more CIR (Consumer Infra-Red) commands. This is intended for remote control of electronic devices such as TV boxes, HiFi sets, etc. DIRECTIVE can be: SEND_ONCE - send CODE [CODE ...] once SEND_START - start repeating CODE SEND_STOP - stop repeating CODE LIST - list configured remote items SET_TRANSMITTERS - set transmitters NUM [NUM ...] SIMULATE - simulate IR event REMOTE is the name of a remote, as described in the lircd configuration file. CODE is the name of a remote control key of REMOTE, as it appears in the lircd configuration file. NUM is the transmitter number of the hardware device. For the LIST DIRECTIVE, REMOTE and/or CODE can be empty: LIST "" "" - list all configured remote names LIST REMOTE "" - list all codes of REMOTE LIST REMOTE CODE - list only CODE of REMOTE The SIMULATE command only works if it has been explicitly enabled in lircd. -h --help display usage summary -v --version display version -d --device use given lircd socket [/var/run/lirc/lircd] -a --address=host[:port] connect to lircd at this address -# --count=n send command n times EXAMPLES
irsend LIST DenonTuner "" irsend SEND_ONCE DenonTuner PROG-SCAN irsend SEND_ONCE OnkyoAmpli VOL-UP VOL-UP VOL-UP VOL-UP irsend SEND_START OnkyoAmpli VOL-DOWN ; sleep 3 irsend SEND_STOP OnkyoAmpli VOL-DOWN irsend SET_TRANSMITTERS 1 irsend SET_TRANSMITTERS 1 3 4 irsend SIMULATE "0000000000000476 00 OK TECHNISAT_ST3004S" FILES
/etc/lirc/lircd.conf Default lircd configuration file. It should contain all the remotes, their infra-red codes and the corresponding timing and wave- form details. DIAGNOSTICS
If lircd is not running (or /var/run/lirc/lircd lacks write permissions) irsend aborts with the following diagnostics: "irsend: could not connect to socket" "irsend: Connection refused" (or "Permission denied"). SEE ALSO
The documentation for lirc is maintained as html pages. They are located under html/ in the documentation directory. lircd(8), mode2(1), smode2(1), xmode2(1), irrecord(1), irw(1), http://www.lirc.org. irsend 0.8.7pre1 May 2010 IRSEND(1)
All times are GMT -4. The time now is 05:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy