Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
4 replies
Subscribers
7 subscribers
Views
4530 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Is there a way to count the number of lines (char(13)char(10)) in a text file.
lesliem
over 9 years ago
Is there a way to count the number of lines (char(13)char(10)) in a text file. I am using the function readtextfromfile to read the text but I would like to count the number of lines in the text.
Thanks in advance
OriginalPostID-174306
OriginalPostID-174306
Discussion posts and replies are publicly visible
0
Shyam Bommakanti
Certified Lead Developer
over 9 years ago
count(split(<readtextfromfile>, char(10)))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
prestonb
over 9 years ago
This worked for me:
with(
local!string: readtextfromfile(todocument(3548), true),
local!split: split(local!string, char(10)),
length(local!split)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lesliem
over 9 years ago
Thank you both from the responses, they worked great!!!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
youngcheols
over 9 years ago
Just as an aside, length will only give you the number of non-null lines while count will give the count of all lines. Depending on your use case, either one could be useful.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel