- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Re: Removing the first Charater in a text file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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-04-2003 03:07 AM
тАО11-04-2003 03:07 AM
In our Apps when it greneates a text file for the printer it inserts a formfeed (Control L I think) causing an leading blank page on all our printers. If I turn off the Formfeed in the Apps then there is no page break at all and this is messy.
Here is what I want to do and need a little help.
The Apps has a Printer filter script that adds the the printer controls (like -onp, -o compress, etc). In here is could add a shortscript that removes the first charater if it is a formfeed.
My question is what is an easy way to remove just the first charater?
Must be an easy way to do this.
Marty
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2003 03:17 AM
тАО11-04-2003 03:17 AM
Solution#!/bin/sh
read a
a=`expr "$a" : ".\(.*\)"`
echo $a
while read a
do
echo $a
done
then run by piping your file into this script.
Probably prettier ways than this but this is first thing that came to mind.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2003 04:36 AM
тАО11-04-2003 04:36 AM
Re: Removing the first Charater in a text file
the following c programme you can also use as filter, if you have only this app printing, otherwise use command < textfile.
It filter a form feed/line feed in the first line.
Michael
#include "stdio.h"
void main(void)
{
ushort c;
ushort d;
d = 1;
while(!feof(stdin))
{
c = getchar();
if (d == 1)
{
if (c == 12)
{
c = getchar();
if (c == 10)
{
d = 0;
c = getchar();
}
}
}
putchar(c);
d = 0;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2003 06:49 AM
тАО11-04-2003 06:49 AM
Re: Removing the first Charater in a text file
I got it working.
Thanks for the help.
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2003 07:49 PM
тАО11-04-2003 07:49 PM
Re: Removing the first Charater in a text file
Here's the way we do it... (for reference), then we pipe it into the print filter ...
sed -e "1 s/^L//g;\$ s/^L//g" ${file}
Gary
- Tags:
- sed