Subscribe Bookmark RSS Feed

Filling empty cells in a specific “character” column

ileshem

Occasional Contributor

Joined:

Jun 13, 2017

Hello,

I need help with filling empty cells in a specific “character” column.

I was able to find a script that does it to all numeric cells of the entire table, but I need it to edit a specific text column.

 

I have something like the table below and I want to fill the empty cells in the "United" column with an expression like "PASS".

so from this table:

RevOBUnited
ABC1231CB1
ABC321 CB5
CBA2134 
ABC546 CB1
ABC6545 
CBA2136CB1
ABC453 CB5
ABC3218 
CBA2138 

I will get:

RevOBUnited
ABC1231CB1
ABC321 CB5
CBA2134PASS
ABC546 CB1
ABC6545PASS
CBA2136CB1
ABC453 CB5
ABC3218PASS
CBA2138PASS


Appreciate your help.

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson

Super User

Joined:

Jun 22, 2012

Solution
names default to here(1);
dt=current data table();
for each row(
    If(United=="", United="PASS");
);

or to do it interactively,

Type into one blank cell for column United, "PASS"

Then click on that cell and copy it to the paste buffer (Cntl/C)

Then right click on a one of the other blank cells for the column United.

Select the option, "Select Matching Cells"

All blank cells for column United will be selected

Hover over one of the selected cells, and paste into the cell the value from the paste buffer.

All selected cells will now have the word "PASS" pasted into them

Jim
txnelson

Super User

Joined:

Jun 22, 2012

Solution

I should have specified a ":" in front of the reference to the column United......... :United

An even more definative reference is dt:United

Make those changes and it should work

Jim
5 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

Solution
names default to here(1);
dt=current data table();
for each row(
    If(United=="", United="PASS");
);

or to do it interactively,

Type into one blank cell for column United, "PASS"

Then click on that cell and copy it to the paste buffer (Cntl/C)

Then right click on a one of the other blank cells for the column United.

Select the option, "Select Matching Cells"

All blank cells for column United will be selected

Hover over one of the selected cells, and paste into the cell the value from the paste buffer.

All selected cells will now have the word "PASS" pasted into them

Jim
ileshem

Occasional Contributor

Joined:

Jun 13, 2017

Thank you all!

What a quick respond!

I want to use a JSL to do it.

 

When I use that part of the script, it is not working for me:

 

Names Default To Here( 1 );
dt = Current Data Table();
For Each Row( If( United/*###*/ == "", United = "PASS" ) );
Name Unresolved: United{1} in access or evaluation of 'United' , United/*###*/

txnelson

Super User

Joined:

Jun 22, 2012

Solution

I should have specified a ":" in front of the reference to the column United......... :United

An even more definative reference is dt:United

Make those changes and it should work

Jim
Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

The fastest way to do this is to type the word "PASS" into one of the cells. Then select it and use Edit->Copy to copy it to your clipboard.

 

Then right-click on one of the empty cells and choose Select All Matching Cells and then choose Edit->Paste to paste PASS into all the cells.

 

If you want to do this programmatically let us know and I'm sure we can point you in that direction.

 

SelectMatchingPaste.gif

 

-Jeff
Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

@txnelson always beats me! 

-Jeff