HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: scripts
Operating System - Linux
1825764
Members
2075
Online
109687
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2007 07:53 AM
11-08-2007 07:53 AM
scripts
i have a dat (text ) . Example
abcd:abcd:acbd
cdlcd:cdcdc:cdcd
more than 50 row.
I want to display on screen with numbering and should be fix in one screen. like slit one column into 3 or 2.
I want out put like that
1.abcd:abcd:acbd 2.cdlcd:cdcdc:cdcd
3. 4.
abcd:abcd:acbd
cdlcd:cdcdc:cdcd
more than 50 row.
I want to display on screen with numbering and should be fix in one screen. like slit one column into 3 or 2.
I want out put like that
1.abcd:abcd:acbd 2.cdlcd:cdcdc:cdcd
3. 4.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2007 07:08 PM
11-08-2007 07:08 PM
Re: scripts
Which OS is this for, HP-UX?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2007 07:46 PM
11-08-2007 07:46 PM
Re: scripts
Hi,
on HP-UX:
cat -n | paste -s -d"\t\n" -
Rgds,
Art
N.B. Please assign points!
on HP-UX:
cat -n
Rgds,
Art
N.B. Please assign points!
- Tags:
- paste
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2007 10:26 AM
11-14-2007 10:26 AM
Re: scripts
Down and dirty -
num=0
cat "your_data_file" | while read line
do
let num="$num+1"
expr "$num" % 2 | read mod
if [ $mod != "0" ]
then
echo "$num". "$line \c" >> output_file
else
echo "$num". "$line " >>output_file
fi
done
Change $num % 2 to $num % 3 for 3 columns and so on.
Regards,
-dl
num=0
cat "your_data_file" | while read line
do
let num="$num+1"
expr "$num" % 2 | read mod
if [ $mod != "0" ]
then
echo "$num". "$line \c" >> output_file
else
echo "$num". "$line " >>output_file
fi
done
Change $num % 2 to $num % 3 for 3 columns and so on.
Regards,
-dl
"I'm not dumb. I just have a command of thoroughly useless information."
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP