473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

<Cut Command>

Hi,

Just want to ask if cut command is capable of , please consider below:

$cat read.txt
1
2
3
4
--------------------------------
Expected Output should get 1,2,3,4 one by one and pass it individually in a file.

1 > a , 2 > b, 3 > c, 4 > d

Thanks in Advance!!!
Aug 26 '07 #1
1 1774
Hi,

Just want to ask if cut command is capable of , please consider below:

$cat read.txt
1
2
3
4
--------------------------------
Expected Output should get 1,2,3,4 one by one and pass it individually in a file.

1 > a , 2 > b, 3 > c, 4 > d
No.
With bash3 you can write something like this:
Expand|Select|Wrap|Line Numbers
  1. bash 3.2.13(1) $ paste -sd, <(paste -d">" <(printf "%s\n" $(<read.txt)) <(printf "$(printf "%s\n" {a..d})"))
  2. 1>a,2>b,3>c,4>d
Aug 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
4
by: David Lozzi | last post by:
Howdy, I'm using a WYSIWYG editor called TinyMCE. When I edit some text and then save it back to my SQL server using a SQLCommand, all HTML characters are changed to HTML code, i.e. &gt;strong&lt;...
6
by: comp.lang.php | last post by:
I am trying to pipe in some auto-generated PHP into php.exe, to no avail: catch {exec echo '<? if (@is_file("./functions.inc.php")) { require_once("./functions.inc.php"); echo...
9
by: gelangov | last post by:
I have 2 variables, one is the column name of the table and the other one is the table name and I need to write this in the "Execute SQL task" of a "For each loop" container in a ssis package like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.