473,408 Members | 1,676 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,408 software developers and data experts.

Beginner!! How to convert data from 1 row to 1 column without sed??

Hi there,
I have only been using linux for 2 weeks and am struggling with loops. My data is in the form...

Expand|Select|Wrap|Line Numbers
  1. [lg45@dev64-mgmt ~]$ echo $start
  2. 25293633 7393500 10578865 25293623 122206254 26797134 41906484
Id like it to output as

25293633
7393500
10578865
25293623
122206254
26797134
41906484

In the current format, if i were to loop it such as 'for i in $start..... would it work or does it need to be in columns? I dont know if the loop im writing is failing because of this or not...

Expand|Select|Wrap|Line Numbers
  1. [lg45@dev64-mgmt ~]$ for i in `seq 1 7`; do awk '{ if($3=10 && '$start'>=25293633 && '$stop'<=26315393) print$0}' map.txt; done
  2. awk: cmd. line:1: { if($3=10 && 25293633
  3. awk: cmd. line:1:                       ^ unexpected newline or end of string
Thanks in advance to anyone who can help :)

Regards
lel
Jun 23 '10 #1
1 2793
Hydaral
24
Expand|Select|Wrap|Line Numbers
  1. {
  2.     i = 1
  3.     do {
  4.         print $i
  5.         i++
  6.     }
  7.     while (i <= NF)
  8. }
Jun 25 '10 #2

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

Similar topics

0
by: Marco | last post by:
Hi all, as I'll unfortunately always be a newbie, I need your help on this issue. I need to suggest to our customers a way to crate partitions on our tables, without having to add any new...
4
by: alederer | last post by:
Hallo! I need to convert the values of a varchar (..) for bit data column to a string which can be stored in a normal varchar column (with additional information). Is there a function in db2...
2
by: Sean | last post by:
How can I go about masking the data in a DataGrid Data column? For example, I load a DataSet with somebody's contact information. How can I make the phone number data, which is stored as: ...
2
by: Bernard Dhooghe | last post by:
The information center writes: "Encryption Algorithm: The internal encryption algorithm used is RC2 block cipher with padding, the 128-bit secret key is derived from the password using a MD2...
1
by: neeraj | last post by:
Hi All Can any give me the code for convert "DataColumn" data type of "DataTable". Even if data table already populated (have data) Actually I am creating one search module which searches the...
8
by: =?Utf-8?B?UmljYXJkbyBRdWludGFuaWxsYQ==?= | last post by:
i need to convert data from string to nibble wich (nibble is a four bits representation) As example i have the following code string data1 = "12345678"; so ¿how can i convert this data...
2
by: Yane Maria | last post by:
I have xml data in my vb.net mobile application: customer.xml <dataset> <customers> <customerid>BONAP</customerid> <companyname>Bon app'</companyname> <contactname>Laurence...
11
by: giveDsolution | last post by:
Hope to find the Solution, My requirment is, I have set AutoGenerateColumns=True for a gridview as i have to add columns at runtime. My first question is: How to hide a column ? And my second...
0
by: Alexandre Brisebois | last post by:
I have been trying to use Linq o SQL to query an XML data column I currently have in my DB, but it seems that Linq to SQL sees a typed xml column as an XElement, I don't want to get the full...
1
by: Tjwapa | last post by:
How do i convert a column with id letters in a file to a number 1 or 0 in coldfusion output....for example 'CON' or 'BUS' to be converted to an output of '0'and '1' (0 to represent CON and 1 for...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.