SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
kmin87
Fluorite | Level 6

I want to import a text file and based on the chat logs from that chatroom, i want to create a weekly summary of how many letters the chatter typed for the week.

 

How do i create a code to accomplish this? The text file is in this format

--------------- Monday, August 2, 2021 ---------------

[A] [7:00 PM] Aaaaaand its still down

[B 🤙] [7:34 PM] Photo

--------------- Tuesday, August 23, 2021 ---------------

 

End state below (for example):

A: 20

B: 0

From 1-7 Aug 2021

2 REPLIES 2
Reeza
Super User
I suspect you cannot actually ignore those emoticons by the way.

Can you please include a slightly larger sample that maybe has some actual content like the images or comma's, punctuation, line endings which usually cause issues. Your data as shown is trivial to import but any solution will not work on your actual data.
ballardw
Super User

"Letters" as in number of characters?

Or "Letters" as in number of messages? If number of messages what in that example actually identifies "the chatter"?

 

Where do you get 20 for A? Your example shows maybe 1 message and the second period is 21 days later, much more than a "week".

Any desired /expected result must be based on input examples to have a good chance of matching expectations.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 606 views
  • 1 like
  • 3 in conversation