[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

file line size

Posted on 2010-08-12
8
Medium Priority
?
537 Views
Last Modified: 2013-12-26
Can u please let me know if the line size is 350 in attached file.
Are can u please let me know an easy way to check this. I transfered teh file from unix to windows b4 attaching here, since the file is in unix directory.
test
0
Comment
Question by:Sara_j_11
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 668 total points
ID: 33424043
no
perl -ne 'print length,"\n"' test
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 33424069
Each line has 344 characters.
[maciek@black:~/EE]% cat test| while read line; do echo -n ${line} | wc -c; done
344
344
344
344
344
344
[maciek@black:~/EE]% 

Open in new window

0
 

Author Comment

by:Sara_j_11
ID: 33424089
wehn i execute it I get the result:
as
345
345
345
345
345


does that mean that line size is 345?
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 23

Expert Comment

by:Maciej S
ID: 33424116
345 with "new line" character (344 without it). Yes.
0
 
LVL 84

Expert Comment

by:ozo
ID: 33424386
not counting the line terminator
perl -lne 'print length' test
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 668 total points
ID: 33425653
awk '{print length($0)}' test

"not counting the line terminator"
0
 
LVL 9

Assisted Solution

by:Murugesan Nagarajan
Murugesan Nagarajan earned 664 total points
ID: 33633951
Updated command using awk without counting the line terminator:

            awk '{print length}' test
or:
           awk '{print "Number of characters in the LINE"NR": "length}' test
0
 
LVL 9

Expert Comment

by:Murugesan Nagarajan
ID: 33633958
Example command using read:

while read NumberOfCharcters
do
echo ${#NumberOfCharcters}
done < test


0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question